<%@ page import="java.util.Map" %>
<%@ page import="java.util.Arrays" %><%--
  Created by IntelliJ IDEA.
  User: dailyblue
  Date: 2024/1/20
  Time: 17:10
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>request对象2️⃣</title>
</head>
<body>
<%--获取到浏览器发送过来的数据--%>
<%
    // 设置编码集 只针对于post
    request.setCharacterEncoding("utf-8");
    // 接收单个数据 name:发送的名称
    String name = request.getParameter("name"); // 🌟🌟🌟🌟🌟
    String password = request.getParameter("password");
    String gender = request.getParameter("gender");
    String birthday = request.getParameter("birthday");
    String weight = request.getParameter("weight");
    // 接收多个数据 数组形式
    String[] loves = request.getParameterValues("loves");
    // 接收所有数据
    Map<String, String[]> all = request.getParameterMap();
    out.print("姓名：" + name + "<br/>");
    out.print("密码：" + password + "<br/>");
    out.print("性别：" + gender + "<br/>");
    out.print("生日：" + birthday + "<br/>");
    out.print("体重：" + weight + "<br/>");
    out.print("爱好：" + Arrays.toString(loves) + "<br/>");
    out.print("所有：" + all + "<br/>");
%>
</body>
</html>